using System;
using System.Collections.Generic;
using System.Web.Http;
using secondhand.Models;

namespace secondhand.Controllers
{
    // [ApiController]
    
    [RoutePrefix("api/v1/")]
    public class PeopleController : ApiController
    {
        public Person Get()
        {
            var person = new Person {Name = "嘻嘻"};
            return person;
        }

        [Route("people/getaa/{id}")]
        public string GetAa(string id)
        {
            return "我事aa"+id;
        }

        [HttpPost]
        public R Create([FromBody]Person person)
        {
            Console.WriteLine(person);
            Console.WriteLine(person.Id);
            return R.Success();
        }
    }
}

public class Person
{
    public string Name { get; set; }
    public String Id { get; set; }
    public override string ToString()
    {
        return Name.ToString();
    }
}